/**
 * 
 */
package br.com.buscapecas.formatter;

import java.text.NumberFormat;


/**
 * @created 18/05/2010 - 09:44:13
 * @author Maikon Rafael da Rocha
 *
 */
public class IntegerFormatter extends Formatter {

    /**
     * 
     * @param integerNumber
     * @param integers
     * @return
     * @created 18/05/2010 - 10:06:40
     * @author Maikon Rafael da Rocha
     */
    public static String formatInteger(Integer integerNumber, int integers) {
        try {
            NumberFormat numberFormat = NumberFormat.getIntegerInstance(ptBR);
            numberFormat.setMinimumIntegerDigits(integers);
            numberFormat.setMaximumIntegerDigits(integers);
            numberFormat.setGroupingUsed(false);
            return numberFormat.format(integerNumber);
        } catch (Exception e) {
            e.printStackTrace();
            return "";
        }
    }

    /**
     * 
     * @param integerNumber
     * @return
     * @created 18/05/2010 - 10:06:36
     * @author Maikon Rafael da Rocha
     */
    public static String formatInteger(Integer integerNumber) {
        try {
            NumberFormat numberFormat = NumberFormat.getIntegerInstance(ptBR);
            numberFormat.setGroupingUsed(true);
            return numberFormat.format(integerNumber);
        } catch (Exception e) {
            e.printStackTrace();
            return "";
        }
    }
    
}
